From: Parker Snell Date: Mon, 14 Aug 2017 18:02:07 +0000 (-0700) Subject: Fix #4370 - init panic in C:\ or / X-Git-Tag: archive/raspbian/0.35.0-2+rpi1~3^2^2^2^2^2^2^2~22^2~7^2~14^2 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=50879f33a8a8697a00db7280542aeaf7c8bb4f4d;p=cargo.git Fix #4370 - init panic in C:\ or / --- diff --git a/src/cargo/ops/cargo_new.rs b/src/cargo/ops/cargo_new.rs index eddcd433c..a52029486 100644 --- a/src/cargo/ops/cargo_new.rs +++ b/src/cargo/ops/cargo_new.rs @@ -403,7 +403,7 @@ fn mk(config: &Config, opts: &MkOptions) -> CargoResult<()> { if !opts.bin { "glob:Cargo.lock\n" } else { "" }] .concat(); - let in_existing_vcs_repo = existing_vcs_repo(path.parent().unwrap(), config.cwd()); + let in_existing_vcs_repo = existing_vcs_repo(path.parent().unwrap_or(path), config.cwd()); let vcs = match (opts.version_control, cfg.version_control, in_existing_vcs_repo) { (None, None, false) => VersionControl::Git, (None, Some(option), false) => option,